package org.insia.smartposse.mail;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

/**
 * Classe permettant de s'authentifier sur un serveur de mail
 * @author guillaume villain 
 * Project : Javamail 
 * Class : org.insia.vmail.mail.smtp 
 * File : SmtpAuthentificator.java 
 * Created : 14 nov. 06 22:01:19
 */
public class MailAuthentificator extends Authenticator {
    private String user;
    private String password;

    /**
     * @param user
     * @param password
     */
    public MailAuthentificator(String user, String password) {
        super();
        this.user = user;
        this.password = password;
    }

    /**
     * @see javax.mail.Authenticator#getPasswordAuthentication()
     */
    @Override
    public PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(user, password);
    }
}
